using System;
using System.Data;
using System.Linq;
using System.Data.Linq;
using System.Linq.Expressions;
using System.Data.Linq.Mapping;
using System.Collections;
using System.Collections.Generic;
using Widgetsphere.Core.DataAccess;

namespace ACME.Northwind.Business.LINQ
{
	/// <summary>
	/// This is a helper object for running LINQ queries on the Customer collection.
	/// </summary>
	[Serializable()]
	[Table(Name = "Customers")]
	public partial class CustomerQuery : IBusinessObjectLINQQuery
	{
		#region Properties
		/// <summary>
		/// (Maps to the 'Customers.Region' database field)
		/// </summary>
		[Column(Name = "Region", DbType = "NVarChar(15)", CanBeNull = true, IsPrimaryKey = false)]
		public virtual string Region { get; set; }
		/// <summary>
		/// (Maps to the 'Customers.PostalCode' database field)
		/// </summary>
		[Column(Name = "PostalCode", DbType = "NVarChar(10)", CanBeNull = true, IsPrimaryKey = false)]
		public virtual string PostalCode { get; set; }
		/// <summary>
		/// (Maps to the 'Customers.Phone' database field)
		/// </summary>
		[Column(Name = "Phone", DbType = "NVarChar(24)", CanBeNull = true, IsPrimaryKey = false)]
		public virtual string Phone { get; set; }
		/// <summary>
		/// (Maps to the 'Customers.Fax' database field)
		/// </summary>
		[Column(Name = "Fax", DbType = "NVarChar(24)", CanBeNull = true, IsPrimaryKey = false)]
		public virtual string Fax { get; set; }
		/// <summary>
		/// (Maps to the 'Customers.CustomerID' database field)
		/// </summary>
		[Column(Name = "CustomerID", DbType = "NChar(5)", CanBeNull = false, IsPrimaryKey = true)]
		public virtual string CustomerId { get; set; }
		/// <summary>
		/// (Maps to the 'Customers.Country' database field)
		/// </summary>
		[Column(Name = "Country", DbType = "NVarChar(15)", CanBeNull = true, IsPrimaryKey = false)]
		public virtual string Country { get; set; }
		/// <summary>
		/// (Maps to the 'Customers.ContactTitle' database field)
		/// </summary>
		[Column(Name = "ContactTitle", DbType = "NVarChar(30)", CanBeNull = true, IsPrimaryKey = false)]
		public virtual string ContactTitle { get; set; }
		/// <summary>
		/// (Maps to the 'Customers.ContactName' database field)
		/// </summary>
		[Column(Name = "ContactName", DbType = "NVarChar(30)", CanBeNull = true, IsPrimaryKey = false)]
		public virtual string ContactName { get; set; }
		/// <summary>
		/// (Maps to the 'Customers.CompanyName' database field)
		/// </summary>
		[Column(Name = "CompanyName", DbType = "NVarChar(40)", CanBeNull = false, IsPrimaryKey = false)]
		public virtual string CompanyName { get; set; }
		/// <summary>
		/// (Maps to the 'Customers.City' database field)
		/// </summary>
		[Column(Name = "City", DbType = "NVarChar(15)", CanBeNull = true, IsPrimaryKey = false)]
		public virtual string City { get; set; }
		/// <summary>
		/// (Maps to the 'Customers.Address' database field)
		/// </summary>
		[Column(Name = "Address", DbType = "NVarChar(60)", CanBeNull = true, IsPrimaryKey = false)]
		public virtual string Address { get; set; }
		/// <summary>
		/// The date of creation
		/// </summary>
		[Column(Name = "created_date", DbType = "DateTime", CanBeNull = true)]
		public virtual DateTime? CreatedDate { get; set; }
		/// <summary>
		/// The name of the creating entity
		/// </summary>
		[Column(Name = "created_by", DbType = "VarChar(100)", CanBeNull = true)]
		public virtual string CreatedBy { get; set; }
		/// <summary>
		/// The date of last modification
		/// </summary>
		[Column(Name = "modified_date", DbType = "DateTime", CanBeNull = true)]
		public virtual DateTime? ModifiedDate { get; set; }
		/// <summary>
		/// The name of the last modifing entity
		/// </summary>
		[Column(Name = "modified_by", DbType = "VarChar(100)", CanBeNull = true)]
		public virtual string ModifiedBy { get; set; }
		/// <summary>
		/// This is an internal field and is not to be used.
		/// </summary>
		[Column(Name = "time_stamp", DbType = "Binary", CanBeNull = false)]
		public virtual byte[] TimeStamp { get; set; }

		/// <summary>
		/// This is a mapping of the relationship with the CustomerCustomerDemo entity.
		/// </summary>
		[Association(ThisKey = "CustomerId", OtherKey = "CustomerId")]
		public CustomerCustomerDemoQuery CustomerCustomerDemoEntity { get; private set; }
		/// <summary>
		/// This is a mapping of the relationship with the Order entity.
		/// </summary>
		[Association(ThisKey = "CustomerId", OtherKey = "CustomerId")]
		public OrderQuery OrderEntity { get; private set; }

		#endregion

	}

}
